﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="register.aspx.cs" Inherits="HFWebApp.user.register" %>
<%@ Register src="../Control/top.ascx" tagname="top" tagprefix="uc1" %>
<%@ Register src="../Control/end.ascx" tagname="end" tagprefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>红法网</title>
<link href="<%=this.getDemain %>/Style/Style.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/CSS.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
    function onSubmit() {
        var o_uid = $("#uid");
        if (o_uid.val() == "") {
            alert("必须填写用户名");
            o_uid.focus();
            return false;
        }

        var o_pwd = $("#pwd");
        if (o_pwd.val() == "") {
            alert("必须填写密码");
            o_pwd.focus();
            return false;
        }
        var o_pwd2 = $("#pwd2");
        if (o_pwd2.val() == "") {
            alert("必须填写验证密码");
            o_pwd2.focus();
            return false;
        }

        if (o_pwd.val() != o_pwd2.val()) {
            alert("两次输入的密码不一致");
            o_pwd2.focus();
            return false;
        }

        var o_email = $("#email");
        if (o_email.val() == "") {
            alert("邮箱不能为空");
            o_email.focus();
            return false;
        }

        var chkEmail = new RegExp(/\w@\w*\.\w/);
        if (!chkEmail.exec(o_email.val())) {
            alert("Email格式不正确");
            o_email.focus();
            return false;
        }

        var url = "/AjaxSource/UserReg.ashx";
        $.getJSON(
        url,
        { uid: o_uid.val() ,pwd:o_pwd.val() ,pwd2:o_pwd2.val(), email:o_email.val(), rand: Math.floor(Math.random() * 10000).toString() },
        function (jsonData) {
                if(jsonData.isTrue)
                {
                    location = jsonData.goUrl;
                }else{
                    alert(jsonData.Message);
                }
            }
        );
        return false;
    }
</script>
</head>

<body>
<uc1:top ID="top1" MenuClassID="1" focusLink1="focusLink" runat="server" />
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom:12px">
  <tr>
    <td align="right"><img src="<%=this.getDemain %>/images/lc_2.jpg" width="458" height="43" /></td>
  </tr>
</table>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0" class="bk_h">
  <form id="userregForm" onsubmit="return onSubmit();">
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="right" class="h_12" style="padding-right:12px">请注意带有*的是必须填写的项目</td>
      </tr>
    </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="140" height="40" align="right" class="hei_14_x">*设置会员登录名: </td>
          <td><input name="uid" type="text" class="sst_x" id="uid" size="40" /></td>
        </tr>
    </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="40" style="padding-left:140px">用于登陆红法网的账号名称，可由汉字、字母、数字和下划线组成</td>
        </tr>
    </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="140" height="40" align="right" class="hei_14_x">*设置密码: </td>
          <td><input name="pwd" type="password" class="sst_x" id="pwd" size="40" /></td>
        </tr>
      </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="40" style="padding-left:140px">密码太短，长度为6~12位，字母区分大小写</td>
        </tr>
    </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="140" height="40" align="right" class="hei_14_x">*再次输入密码: </td>
          <td><input name="pwd2" type="password" class="sst_x" id="pwd2" size="40" /></td>
        </tr>
      </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="40" style="padding-left:140px">请再输入一次您的登录密码</td>
        </tr>
    </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="140" height="40" align="right" class="hei_14_x">*电子邮箱: </td>
          <td><input name="email" type="text" class="sst_x" id="email" size="40" /></td>
        </tr>
      </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="40" style="padding-left:140px">强烈建议您填写有效的E-mail地址，方便接收法律咨询回复的邮件提示等</td>
        </tr>
    </table>
      <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="40" style="padding-left:140px"><input  id="Button1" type="image" src="<%=this.getDemain %>/images/an_tj_3.jpg" />　<img src="<%=this.getDemain %>/images/an_tj_4.jpg" width="92" height="35" /></td>
        </tr>
    </table></td>
  </tr>
  </form>
</table>
<uc2:end ID="end1" runat="server" />
</body>
</html>
